<template>
  <div>
    <el-form ref="dataForm" :inline="true" :model="formdata" label-position="left" label-width="100px" class="ml50">
      <el-row>
        <el-col :span="10">
          <el-form-item label="所属社区" prop="title">
            <el-input v-model="formdata.organ_name" readonly />
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="所属网格" prop="title">
            <el-input v-model="formdata.grid_name" readonly />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">
          <el-form-item label="建设时间" prop="timestamp">
            <el-date-picker v-model="formdata.build_time" style="width: 100%;" readonly type="date" placeholder="请选择日期" />
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="小区名称" prop="title">
            <el-input v-model="formdata.name" readonly />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">
          <el-form-item label="小区物业" prop="title">
            <el-input v-model="formdata.property" readonly />
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="小区地址" prop="title">
            <el-input v-model="formdata.address" readonly style="width: 200%;" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="10">
          <el-form-item label="小区联系人" prop="title">
            <el-input v-model="formdata.contacts" readonly min="150%" />
          </el-form-item>
        </el-col>
        <el-col :span="14">
          <el-form-item label="联系电话" prop="number">
            <el-input v-model="formdata.tel" readonly />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="小区介绍">
          <el-input
            v-model="formdata.intro"
            style="width: 200%;"
            readonly
            resize="both"
            :autosize="{ minRows: 4, maxRows: 6}"
            type="textarea"
          />
        </el-form-item>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="dialogClose">
        确定
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Detail',
  props: { // 接受父组件传过来参数值的子组件参数
    detailId: {
      type: Number
    }
  },
  data() {
    return {
      formdata: {}
    }
  },
  computed: {

  },
  watch: {

  },
  created() {
    this.load_data()
  },
  methods: {
    //* *****************  通用业务  **************************
    load_data() {
      this.$api.project.projectview({
        id: this.detailId
      }).then(response => {
        this.formdata = response.data
      })
    },

    //* *****************  基础业务  **************************
    dialogClose() {
      this.$emit('dialogClose', false)
    }
  }
}
</script>
